POST
/
public
/
v1
/
toptimize
/
forecasting
/
campaign
[BETA] Campaign-level Forecasts
curl --request POST \
  --url https://api.topsort.com/public/v1/toptimize/forecasting/campaign \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "bids": {
    "inventory": [],
    "productIds": [
      "<string>"
    ]
  },
  "budget": {
    "amount": 1,
    "type": "daily"
  },
  "campaignType": "autobidding",
  "targetRoas": 1,
  "timeWindow": 7
}'
[
  {
    "forecastDate": "2025-01-15",
    "metrics": [
      {
        "metricName": "impressions",
        "values": {
          "forecastIntervalMax": 5600,
          "forecastIntervalMin": 4900,
          "forecastValue": 5250
        }
      },
      {
        "metricName": "clicks",
        "values": {
          "forecastIntervalMax": 1120,
          "forecastIntervalMin": 980,
          "forecastValue": 1050
        }
      },
      {
        "metricName": "purchases",
        "values": {
          "forecastIntervalMax": 112,
          "forecastIntervalMin": 98,
          "forecastValue": 105
        }
      }
    ]
  },
  {
    "forecastDate": "2025-01-16",
    "metrics": [
      {
        "metricName": "impressions",
        "values": {
          "forecastIntervalMax": 5750,
          "forecastIntervalMin": 5050,
          "forecastValue": 5400
        }
      },
      {
        "metricName": "clicks",
        "values": {
          "forecastIntervalMax": 1150,
          "forecastIntervalMin": 1010,
          "forecastValue": 1080
        }
      },
      {
        "metricName": "purchases",
        "values": {
          "forecastIntervalMax": 115,
          "forecastIntervalMin": 101,
          "forecastValue": 108
        }
      }
    ]
  }
]

Authorizations

Authorization
string
header
required

A valid API key generated in Topsort's UI.

Body

application/json

Request model for campaign forecasts with the new structure.

bids
object
required

Bid targets information

budget
object
required

Campaign budget information

targetRoas
number
required

Target Return on Ad Spend for the campaign

Required range: x > 0
campaignType
enum<string>

Campaign type (For v1, only autobidding is supported)

Available options:
autobidding
timeWindow
integer
default:7

How many days to forecast into the future

Required range: 1 <= x <= 14

Response

Successful Response

forecastDate
string<date>
required

Date of the forecast

metrics
MetricForecast · object[]
required

List of metric forecasts for this date